﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.PlanContxt;
using SlamDunk.MES.Domain.IRepositories.Interfaces.PlanContxt;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.PlanContxt
{
    /// <summary>
    /// 销售订单明细仓储实现
    /// </summary>
    public class SaleOrderDetailRepository : EFEntityRepositoryProvider<SaleOrderDetail>, ISaleOrderDetailRepository
    {
        #region # 获取销售订单明细列表 —— ICollection<SaleOrderDetail> Find(Guid saleOrderId)
        /// <summary>
        /// 获取销售订单明细列表
        /// </summary>
        /// <param name="saleOrderId">销售订单Id</param>
        /// <returns>销售订单明细列表</returns>
        public ICollection<SaleOrderDetail> Find(Guid saleOrderId)
        {
            IQueryable<SaleOrderDetail> details = base.Find(x => x.SaleOrder.Id == saleOrderId);

            return details.ToList();
        }
        #endregion
    }
}
